package com.woniuxy.mapper;

import com.woniuxy.entity.FoodComment;
import com.woniuxy.entity.FoodCommentExample;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Param;


/*
@author Jan
@create 2020-05-20 19:00

*/

public interface FoodCommentMapper {
    long countByExample(FoodCommentExample example);

    int deleteByExample(FoodCommentExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(FoodComment record);

    int insertSelective(FoodComment record);

    List<FoodComment> selectByExample(FoodCommentExample example);

    FoodComment selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") FoodComment record, @Param("example") FoodCommentExample example);

    int updateByExample(@Param("record") FoodComment record, @Param("example") FoodCommentExample example);

    int updateByPrimaryKeySelective(FoodComment record);

    int updateByPrimaryKey(FoodComment record);

    /**
     *查询该proId的所有评论
     * @param map
     * @return
     */
    List<FoodComment> selectFoodCommentByFoodId(Map map);

    /**
     * 查询用户是否对美食评论过
     * @param foodOrderId
     * @param foodId
     * @param userId
     * @return
     */
    int selectIsOrYesFoodComment(Integer foodOrderId, Integer foodId, Integer userId);
}